import React from "react";
import { getStorage } from '@/utils/storage';
import { Button } from "antd";

const PermissionBtn = ({id, children, ...props}) => {
  const userInfo = getStorage('userInfo');
  
  const hasPermission = userInfo?.functions?.includes(id);

  return hasPermission ? <Button {...props}>{children}</Button> : undefined;
}
export default PermissionBtn;